<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <style>
        body {
            display: flex;
            height: 100vh;
            border: 0;
            margin: 0;
            width: 100vw;
        }
    </style>
    <body></body>
    <script type="importmap">
        {
            "imports": {
                "monaco-editor-solid": "https://cdn.jsdelivr.net/npm/monaco-editor-solid@1.0.4/dist/index.min.js",
                "monaco-editor-solid": "./dist/index.js",
                "monaco-editor-solid/": "./dist/",

                "solid-js": "https://cdn.skypack.dev/solid-js",
                "solid-js/web": "https://cdn.skypack.dev/solid-js/web"
            }
        }
    </script>
    <script type="module">
        import { render } from "solid-js/web";
        import * as vscode from "monaco-editor-solid/api/api.js";

        import {
            FileEditorList,
            applyTheme,
            ExtensionManager,
            monaco,
            exts,
        } from "monaco-editor-solid";
        globalThis.monaco = monaco;
        globalThis.vscode = vscode;
        applyTheme("github-dark");

        render(
            () =>
                FileEditorList({
                    toggleExplorer(bool) {
                        console.log("open Explorer");
                    },
                    fs: {
                        promises: {
                            writeFile(id, code) {
                                console.log({ code, id });
                            },
                            readFile() {
                                console.log(arguments);
                                return `
                                        ParseResult(
            scheme='https',
            netloc='juejin.im',
            path='/user/5da32395e51d4578200cc9c5/posts',
            params='',
            query='params=123&username=123',
            fragment=''
        )
        `;
                            },
                        },
                    },
                    files: [
                        ["/index.html", "/343434.js"],
                        ["/23232.json"],
                        ["/1.py"],
                    ],
                }),
            document.body
        );
    </script>
</html>
